# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1ZoneDiscoverySpecCsvOptions do
  @moduledoc """
  Describe CSV and similar semi-structured data formats.

  ## Attributes

  *   `delimiter` (*type:* `String.t`, *default:* `nil`) - Optional. The delimiter being used to separate values. This defaults to ','.
  *   `disableTypeInference` (*type:* `boolean()`, *default:* `nil`) - Optional. Whether to disable the inference of data type for CSV data. If true, all columns will be registered as strings.
  *   `encoding` (*type:* `String.t`, *default:* `nil`) - Optional. The character encoding of the data. The default is UTF-8.
  *   `headerRows` (*type:* `integer()`, *default:* `nil`) - Optional. The number of rows to interpret as header rows that should be skipped when reading data rows.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :delimiter => String.t() | nil,
          :disableTypeInference => boolean() | nil,
          :encoding => String.t() | nil,
          :headerRows => integer() | nil
        }

  field(:delimiter)
  field(:disableTypeInference)
  field(:encoding)
  field(:headerRows)
end

defimpl Poison.Decoder,
  for: GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1ZoneDiscoverySpecCsvOptions do
  def decode(value, options) do
    GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1ZoneDiscoverySpecCsvOptions.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for: GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1ZoneDiscoverySpecCsvOptions do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
